<template>
  <div>
    <Banner />
    <!-- 享活动 -->
    <Activity />
    <Enroll />
    <!-- 汇资讯 -->
    <Information />
    <!-- 游林芝 -->
    <Swimming />
    <img :src="advert" width="100%" :height="advertHeight + 'px'" />
    <!-- 学才艺 -->
    <Skill />
    <!-- 读好书 -->
    <Read />
    <!-- 订场馆 -->
    <Site />
    <Friendly-link />
  </div>
</template>

<script>
import Banner from "@/components/Banner/index";
import Activity from "@/views/home/cp/Activity";
import Enroll from "@/views/home/cp/Enroll";
import Information from "@/views/home/cp/Information";
import Swimming from "@/views/home/cp/Swimming";
import Skill from "@/views/home/cp/Skill";
import Read from "@/views/home/cp/Read";
import Site from "@/views/home/cp/Site";
import FriendlyLink from "@/views/home/cp/FriendlyLink";
export default {
  name: "home",
  components: { Banner, Activity, Enroll, Information, Skill, Read, Site, FriendlyLink,Swimming },
  data() {
    return {
      advert: require('@/assets/b.png'), // 广告位
      advertHeight: 389, // 广告位高度
    };
  },
  mounted() {
    this.handleResize();
    window.addEventListener("resize", this.handleResize);
  },
  methods: {
    // 自适应banner图高度
    handleResize() {
      this.advertHeight = document.body.clientWidth / 4.93;
    },
  },
};
</script>

<style lang="scss" scoped></style>
